import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '用户账户',
    align: 'center',
    dataIndex: 'userName',
  },
  {
    title: '用户Id',
    align: 'center',
    dataIndex: 'userId',
  },
  {
    title: '提现金额',
    align: 'center',
    dataIndex: 'cashNum',
  },
  {
    title: '提现状态',
    align: 'center',
    dataIndex: 'status',
  },
  {
    title: '提交时间',
    align: 'center',
    dataIndex: 'createTime',
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '用户ID',
    field: 'userId',
    component: 'Input',
    //colProps: { span: 6 },
  },
  {
    label: '用户名称',
    field: 'userName',
    component: 'Input',
  },
  {
    label: '状态',
    field: 'status',
    component: 'Select',
    componentProps: {
      options: [
        { label: '待提现', value: '0' },
        { label: '已提现', value: '1' },
      ],
    },
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '用户账户',
    field: 'userName',
    component: 'Input',
    componentProps: ({ formActionType, schema, formModel }) => {
      return {
        disabled: formModel.id != null, // 编辑状态下禁用
      };
    },
  },
  {
    label: '用户Id',
    field: 'userId',
    component: 'Input',
    componentProps: ({ formActionType, schema, formModel }) => {
      return {
        disabled: formModel.id != null, // 编辑状态下禁用
      };
    },
  },
  {
    label: '提现金额',
    field: 'cashNum',
    component: 'InputNumber',
    componentProps: ({ formActionType, schema, formModel }) => {
      return {
        disabled: formModel.id != null, // 编辑状态下禁用
      };
    },
  },
  {
    label: '提款状态',
    field: 'status',
    component: 'Select',
    componentProps: {
      options: [
        { label: '待提现', value: '0' },
        { label: '已提现', value: '1' },
      ],
    },
  },
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}